package cn.xiaopengstack.persistent.po;

import lombok.Data;

import java.util.Date;

/**
 * 
 * @TableName mcp_config
 */
@Data
public class McpConfig {
    /**
     * 
     */
    private Long id;

    /**
     * mcp应用的名字
     */
    private String mcpAppName;

    /**
     * json字段的名字
     */
    private String mcpAppKey;

    /**
     * JSON格式的MCP配置
     */
    private String mcpConfigJson;

    /**
     * JSON 格式的其他配置项
     */
    private String mcpConfigValue;

    /**
     * mcp 通信类型
     */
    private String mcpTransportType;

    /**
     * 
     */
    private Date createTime;

    /**
     * 
     */
    private Date updateTime;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        McpConfig other = (McpConfig) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getMcpAppName() == null ? other.getMcpAppName() == null : this.getMcpAppName().equals(other.getMcpAppName()))
            && (this.getMcpAppKey() == null ? other.getMcpAppKey() == null : this.getMcpAppKey().equals(other.getMcpAppKey()))
            && (this.getMcpConfigJson() == null ? other.getMcpConfigJson() == null : this.getMcpConfigJson().equals(other.getMcpConfigJson()))
            && (this.getMcpConfigValue() == null ? other.getMcpConfigValue() == null : this.getMcpConfigValue().equals(other.getMcpConfigValue()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getMcpAppName() == null) ? 0 : getMcpAppName().hashCode());
        result = prime * result + ((getMcpAppKey() == null) ? 0 : getMcpAppKey().hashCode());
        result = prime * result + ((getMcpConfigJson() == null) ? 0 : getMcpConfigJson().hashCode());
        result = prime * result + ((getMcpConfigValue() == null) ? 0 : getMcpConfigValue().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", mcpAppName=").append(mcpAppName);
        sb.append(", mcpAppKey=").append(mcpAppKey);
        sb.append(", mcpConfigJson=").append(mcpConfigJson);
        sb.append(", mcpConfigValue=").append(mcpConfigValue);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append("]");
        return sb.toString();
    }
}